package java04;

import java.util.Random;
import java.util.Scanner;

public class LOOP {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

//        int a = sc.nextInt();
//        switchTest(a);

//        daffodilNumber();

//        print99();

//        whileTest(10);

//        daffodilNumber2();

//        dowhileTest(0);

        randomTest();
    }

    public static void  daffodilNumber() {
        int count=0;
        for (int i = 100; i <1000 ; i++) {
            int ge=i%10,shi=i/10%10,bai=i/10/10%10;
            if(ge*ge*ge+shi*shi*shi+bai*bai*bai == i){
                System.out.println(i);
                count++;
            }

        }
        System.out.println(count);
    }

    public static void print99() {
        for (int i = 1; i < 10 ; i++) {
            for (int j = 1; j <= i ; j++) {
                System.out.print(j + "*" + i + "=" + i*j + "\t");
            }
            System.out.println();
        }
    }

    public static void switchTest(int a) {
        switch (a){
            case 1,2 -> System.out.println("是1或2");
            default -> System.out.println("输入有误");
        }

    }

    public static void whileTest(int a) {
        while (a!=0) {
            System.out.println(a);
            a--;
        }

    }

    public static void daffodilNumber2() {
        int count1 =0;
        int j =100;
        while(j <1000){
            int ge= j %10;int shi= j /10%10;int bai= j /10/10%10;
            if(ge*ge*ge+shi*shi*shi+bai*bai*bai == j) {
                System.out.println(j);
                count1++;
            }
            j++;
        }
        System.out.println(count1);
    }

    public static void dowhileTest(int a) {
        do {
            System.out.println(a);
            a--;
        }while (a>0);

    }

    public static void breakandcontinueTest() {

    }

    public static void randomTest() {
        Random r = new Random();
        int e=r.nextInt(100)+1;
        Scanner sc = new Scanner(System.in);
        while(true){
            int ee= sc.nextInt();
            if(ee>e) System.out.println("猜大了");
            else if (ee<e) System.out.println("猜小了");
            else{
                System.out.println("猜对了！");
                break;
            }
        }
    }

}
